using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MKDS_Course_Editor
{
    public partial class obj : Form
    {
        string file_;
        public obj(string file)
        {
            file_ = file;
            InitializeComponent();
        }

        private void obj_Load(object sender, EventArgs e)
        {
            
        }

        private void viewport1_Click(object sender, EventArgs e)
        {

        }

        private void obj_Shown(object sender, EventArgs e)
        {
            devDept.Eyeshot.Entities.Entity[] t;
            try
            {
                viewport1.ReadOBJ(file_, out t);
                viewport1.Entities.AddRange(t);
            }
            catch (Exception)
            {
                MessageBox.Show("Sorry, but this OBJ file can't be viewed.", "Oops", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();
            }
        }
    }
}
